# -*- coding:utf-8 -*-
# @FileName  :adhcc_0_setup.py
# @Time      :2020/12/25 14:54
# @Author    :Zhoujirong
# @Desc      : 征信用户解绑--》删除征信用户--》删除用户 初始的3个用户

from biz.flow.per_credit_user import PerCreditUserRequest
from common.log import Log
from biz.flow.user import UserRequest
from biz.cases.base_case import BaseCase
from common.utils import get_redis,get_mysql
from conf.settings import DB_TYPE

class TestCleanUser(BaseCase):

    data_file_name = 'setup.yaml'

    @classmethod
    def setUpClass(cls):
        cls.redis = get_redis()
        cls.cookie = BaseCase().get_token_first()
        cls.db = get_mysql(DB_TYPE)

    #第一个用户
    def get_page_one(self):
        '''检索第一个用户'''
        curPage = self.file_data.get('curPage')
        maxSize = self.file_data.get('maxSize')
        search_LIKE_userName = self.file_data.get('userName1')
        search_LIKE_nickName = self.file_data.get('nickName1')
        search_IN_orgId = self.file_data.get('orgId')
        search_IN_userType = self.file_data.get('userType')
        search_EQ_stopFlag = self.file_data.get('stopFlag')
        search_EQ_lockFlag = self.file_data.get('lockFlag')
        ret = UserRequest.get_page(curPage,
            maxSize,
            search_LIKE_userName,
            search_LIKE_nickName,
            search_IN_orgId,
            search_IN_userType,
            search_EQ_stopFlag,
            search_EQ_lockFlag,self.cookie)
        Log.info(ret)
        self.assertIsNotNone(ret.list)
        return ret.list[0]

    def test_a_update_user(self):
        '''角色和用户解绑'''
        data = self.get_page_one()
        address = data.address
        createNickname = data.createNickname
        createTime = data.createTime
        createUsername = data.createUsername
        deptId = data.deptId
        deptName = data.deptName
        desc1 = data.desc1
        desc2 = data.desc2
        desc3 = data.desc3
        desc4 = data.desc4
        desc5 = data.desc5
        desc6 = data.desc6
        ext1 = data.ext1
        ext10 = data.ext10
        ext11 = data.ext11
        ext12 = data.ext12
        ext13 = data.ext13
        ext14 = data.ext14
        ext15 = data.ext15
        ext16 = data.ext16
        ext17 = data.ext17
        ext18 = data.ext18
        ext19 = data.ext19
        ext2 = data.ext2
        ext20 = data.ext20
        ext21 = data.ext21
        ext22 = data.ext22
        ext23 = data.ext23
        ext24 = data.ext24
        ext25 = data.ext25
        ext26 = data.ext26
        ext27 = data.ext27
        ext28 = data.ext28
        ext29 = data.ext29
        ext3 = data.ext3
        ext30 = data.ext30
        ext4 = data.ext4
        ext5 = data.ext5
        ext6 = data.ext6
        ext7 = data.ext7
        ext8 = data.ext8
        ext9 = data.ext9
        id = data.id
        idCard = data.idCard
        ipbindflag = data.ipbindflag
        ipbindnum = data.ipbindnum
        lockFlag = data.lockFlag
        macbindflag = data.macbindflag
        macbindnum = data.macbindnum
        mark = data.mark
        mobile = data.mobile
        nickName = data.nickName
        orgId = data.orgId
        orgPhone = data.orgPhone
        password = data.password
        plainPassword = data.plainPassword
        postCode = data.postCode
        pwdUpdateTime = data.pwdUpdateTime
        resetFlag = data.resetFlag
        roleName = data.roleName
        salt = data.salt
        shortcutFlag = data.shortcutFlag
        stopFlag = data.stopFlag
        stopReason = data.stopReason
        stopTime = data.stopTime
        telephone = data.telephone
        updateNickname = data.updateNickname
        updateTime = data.updateTime
        updateUsername = data.updateUsername
        userEmail = data.userEmail
        userName = self.file_data.get('userName1')
        userType = data.userType
        weiChat = data.weiChat
        orgTree = self.file_data.get('orgTree')
        roleIds = ''
        assignRoleIds = ''
        ret = UserRequest.user_update(assignRoleIds,address,
        createNickname,
        createTime,
        createUsername,
        deptId,
        deptName,
        desc1,
        desc2,
        desc3,
        desc4,
        desc5,
        desc6,
        ext1,
        ext10,
        ext11,
        ext12,
        ext13,
        ext14,
        ext15,
        ext16,
        ext17,
        ext18,
        ext19,
        ext2,
        ext20,
        ext21,
        ext22,
        ext23,
        ext24,
        ext25,
        ext26,
        ext27,
        ext28,
        ext29,
        ext3,
        ext30,
        ext4,
        ext5,
        ext6,
        ext7,
        ext8,
        ext9,
        id,
        idCard,
        ipbindflag,
        ipbindnum,
        lockFlag,
        macbindflag,
        macbindnum,
        mark,
        mobile,
        nickName,
        orgId,
        orgPhone,
        password,
        plainPassword,
        postCode,
        pwdUpdateTime,
        resetFlag,
        roleName,
        salt,
        shortcutFlag,
        stopFlag,
        stopReason,
        stopTime,
        telephone,
        updateNickname,
        updateTime,
        updateUsername,
        userEmail,
        userName,
        userType,
        weiChat,
        orgTree,
        roleIds,self.cookie)
        Log.info(ret)
        self.assertEqual('00000000',ret.code)
        self.assertEqual('操作成功',ret.msg)

    def test_b_perattr_update(self):
        '''用户解绑个人征信用户'''
        data = self.get_page_one()
        createDate = data.createTime
        createUser = data.createUsername
        creditUser = ''
        ext1 = data.ext1
        ext2 = data.ext2
        ext3 = data.ext3
        ext4 = data.ext4
        ext5 = data.ext5
        ext6 = data.ext6
        id = data.id
        interfaceCreditUser = ''
        lockStat = self.file_data.get('lockStat')
        printAmount = self.file_data.get('printAmount')
        printPermit = self.file_data.get('printPermit')
        resCode = self.file_data.get('resCode')
        resMsg = self.file_data.get('resMsg')
        savePermit = self.file_data.get('savePermit')
        serialNumber = self.file_data.get('serialNumber')
        updateDate = data.updateTime
        userName = self.file_data.get('userName1')
        whiteList = self.file_data.get('whiteList')
        ret = UserRequest.per_attr_update(createDate,
                                            createUser,
                                            creditUser,
                                            ext1,
                                            ext2,
                                            ext3,
                                            ext4,
                                            ext5,
                                            ext6,
                                            id,
                                            interfaceCreditUser,
                                            lockStat,
                                            printAmount,
                                            printPermit,
                                            resCode,
                                            resMsg,
                                            savePermit,
                                            serialNumber,
                                            updateDate,
                                            userName,
                                            whiteList,self.cookie)
        Log.info(ret)
        self.assertEqual('00000000', ret.code)
        self.assertIn('操作成功', ret.msg)

    def test_c_entattr_update(self):
        '''用户解绑企业征信用户'''
        data = self.get_page_one()
        amountLimit = self.file_data.get('amountLimit')
        amountQuery = self.file_data.get('amountQuery')
        bindNumber = self.file_data.get('bindNumber')
        bindPermit = self.file_data.get('bindPermit')
        createDate = data.createTime
        createUser = data.createUsername
        creditUser = ''
        downloadPermit = self.file_data.get('downloadPermit')
        ext1 = data.ext1
        ext2 = data.ext2
        ext3 = data.ext3
        ext4 = data.ext4
        ext5 = data.ext5
        ext6 = data.ext6
        id = data.id
        interfaceCreditUser = ''
        lockStat = self.file_data.get('lockStat')
        printAmount = self.file_data.get('printAmount')
        printPermit = self.file_data.get('printPermit')
        resCode = self.file_data.get('resCode')
        resMsg = self.file_data.get('resMsg')
        savePermit = self.file_data.get('savePermit')
        serialNumber = self.file_data.get('serialNumber')
        timeLimit = self.file_data.get('timeLimit')
        updateDate = data.updateTime
        userName = self.file_data.get('userName1')
        whiteList = self.file_data.get('whiteList')
        workTime = self.file_data.get('workTime')
        ret = UserRequest.ent_attr_update(amountLimit,
                            amountQuery,
                            bindNumber,
                            bindPermit,
                            createDate,
                            createUser,
                            creditUser,
                            downloadPermit,
                            ext1,
                            ext2,
                            ext3,
                            ext4,
                            ext5,
                            ext6,
                            id,
                            interfaceCreditUser,
                            lockStat,
                            printAmount,
                            printPermit,
                            resCode,
                            resMsg,
                            savePermit,
                            serialNumber,
                            timeLimit,
                            updateDate,
                            userName,
                            whiteList,
                            workTime, self.cookie)
        Log.info(ret)
        self.assertEqual('00000000', ret.code)
        self.assertIn('操作成功', ret.msg)

    # 第二个用户
    def get_page_two(self):
        '''检索第一个用户'''
        curPage = self.file_data.get('curPage')
        maxSize = self.file_data.get('maxSize')
        search_LIKE_userName = self.file_data.get('userName2')
        search_LIKE_nickName = self.file_data.get('nickName2')
        search_IN_orgId = self.file_data.get('orgId')
        search_IN_userType = self.file_data.get('userType')
        search_EQ_stopFlag = self.file_data.get('stopFlag')
        search_EQ_lockFlag = self.file_data.get('lockFlag')
        ret = UserRequest.get_page(curPage,
                                   maxSize,
                                   search_LIKE_userName,
                                   search_LIKE_nickName,
                                   search_IN_orgId,
                                   search_IN_userType,
                                   search_EQ_stopFlag,
                                   search_EQ_lockFlag, self.cookie)
        Log.info(ret)
        self.assertIsNotNone(ret.list)
        return ret.list[0]

    def test_d_update_user(self):
        '''角色和用户解绑'''
        data = self.get_page_two()
        address = data.address
        createNickname = data.createNickname
        createTime = data.createTime
        createUsername = data.createUsername
        deptId = data.deptId
        deptName = data.deptName
        desc1 = data.desc1
        desc2 = data.desc2
        desc3 = data.desc3
        desc4 = data.desc4
        desc5 = data.desc5
        desc6 = data.desc6
        ext1 = data.ext1
        ext10 = data.ext10
        ext11 = data.ext11
        ext12 = data.ext12
        ext13 = data.ext13
        ext14 = data.ext14
        ext15 = data.ext15
        ext16 = data.ext16
        ext17 = data.ext17
        ext18 = data.ext18
        ext19 = data.ext19
        ext2 = data.ext2
        ext20 = data.ext20
        ext21 = data.ext21
        ext22 = data.ext22
        ext23 = data.ext23
        ext24 = data.ext24
        ext25 = data.ext25
        ext26 = data.ext26
        ext27 = data.ext27
        ext28 = data.ext28
        ext29 = data.ext29
        ext3 = data.ext3
        ext30 = data.ext30
        ext4 = data.ext4
        ext5 = data.ext5
        ext6 = data.ext6
        ext7 = data.ext7
        ext8 = data.ext8
        ext9 = data.ext9
        id = data.id
        idCard = data.idCard
        ipbindflag = data.ipbindflag
        ipbindnum = data.ipbindnum
        lockFlag = data.lockFlag
        macbindflag = data.macbindflag
        macbindnum = data.macbindnum
        mark = data.mark
        mobile = data.mobile
        nickName = data.nickName
        orgId = data.orgId
        orgPhone = data.orgPhone
        password = data.password
        plainPassword = data.plainPassword
        postCode = data.postCode
        pwdUpdateTime = data.pwdUpdateTime
        resetFlag = data.resetFlag
        roleName = data.roleName
        salt = data.salt
        shortcutFlag = data.shortcutFlag
        stopFlag = data.stopFlag
        stopReason = data.stopReason
        stopTime = data.stopTime
        telephone = data.telephone
        updateNickname = data.updateNickname
        updateTime = data.updateTime
        updateUsername = data.updateUsername
        userEmail = data.userEmail
        userName = self.file_data.get('userName2')
        userType = data.userType
        weiChat = data.weiChat
        orgTree = self.file_data.get('orgTree')
        roleIds = ''
        assignRoleIds = ''
        ret = UserRequest.user_update(assignRoleIds, address,
                                      createNickname,
                                      createTime,
                                      createUsername,
                                      deptId,
                                      deptName,
                                      desc1,
                                      desc2,
                                      desc3,
                                      desc4,
                                      desc5,
                                      desc6,
                                      ext1,
                                      ext10,
                                      ext11,
                                      ext12,
                                      ext13,
                                      ext14,
                                      ext15,
                                      ext16,
                                      ext17,
                                      ext18,
                                      ext19,
                                      ext2,
                                      ext20,
                                      ext21,
                                      ext22,
                                      ext23,
                                      ext24,
                                      ext25,
                                      ext26,
                                      ext27,
                                      ext28,
                                      ext29,
                                      ext3,
                                      ext30,
                                      ext4,
                                      ext5,
                                      ext6,
                                      ext7,
                                      ext8,
                                      ext9,
                                      id,
                                      idCard,
                                      ipbindflag,
                                      ipbindnum,
                                      lockFlag,
                                      macbindflag,
                                      macbindnum,
                                      mark,
                                      mobile,
                                      nickName,
                                      orgId,
                                      orgPhone,
                                      password,
                                      plainPassword,
                                      postCode,
                                      pwdUpdateTime,
                                      resetFlag,
                                      roleName,
                                      salt,
                                      shortcutFlag,
                                      stopFlag,
                                      stopReason,
                                      stopTime,
                                      telephone,
                                      updateNickname,
                                      updateTime,
                                      updateUsername,
                                      userEmail,
                                      userName,
                                      userType,
                                      weiChat,
                                      orgTree,
                                      roleIds, self.cookie)
        Log.info(ret)
        self.assertEqual('00000000', ret.code)
        self.assertEqual('操作成功', ret.msg)

    def test_e_perattr_update(self):
        '''用户解绑个人征信用户'''
        data = self.get_page_two()
        createDate = data.createTime
        createUser = data.createUsername
        creditUser = ''
        ext1 = data.ext1
        ext2 = data.ext2
        ext3 = data.ext3
        ext4 = data.ext4
        ext5 = data.ext5
        ext6 = data.ext6
        id = data.id
        interfaceCreditUser = ''
        lockStat = self.file_data.get('lockStat')
        printAmount = self.file_data.get('printAmount')
        printPermit = self.file_data.get('printPermit')
        resCode = self.file_data.get('resCode')
        resMsg = self.file_data.get('resMsg')
        savePermit = self.file_data.get('savePermit')
        serialNumber = self.file_data.get('serialNumber')
        updateDate = data.updateTime
        userName = self.file_data.get('userName2')
        whiteList = self.file_data.get('whiteList')
        ret = UserRequest.per_attr_update(createDate,
                                          createUser,
                                          creditUser,
                                          ext1,
                                          ext2,
                                          ext3,
                                          ext4,
                                          ext5,
                                          ext6,
                                          id,
                                          interfaceCreditUser,
                                          lockStat,
                                          printAmount,
                                          printPermit,
                                          resCode,
                                          resMsg,
                                          savePermit,
                                          serialNumber,
                                          updateDate,
                                          userName,
                                          whiteList, self.cookie)
        Log.info(ret)
        self.assertEqual('00000000', ret.code)
        self.assertIn('操作成功', ret.msg)

    def test_f_entattr_update(self):
        '''用户解绑企业征信用户'''
        data = self.get_page_two()
        amountLimit = self.file_data.get('amountLimit')
        amountQuery = self.file_data.get('amountQuery')
        bindNumber = self.file_data.get('bindNumber')
        bindPermit = self.file_data.get('bindPermit')
        createDate = data.createTime
        createUser = data.createUsername
        creditUser = ''
        downloadPermit = self.file_data.get('downloadPermit')
        ext1 = data.ext1
        ext2 = data.ext2
        ext3 = data.ext3
        ext4 = data.ext4
        ext5 = data.ext5
        ext6 = data.ext6
        id = data.id
        interfaceCreditUser = ''
        lockStat = self.file_data.get('lockStat')
        printAmount = self.file_data.get('printAmount')
        printPermit = self.file_data.get('printPermit')
        resCode = self.file_data.get('resCode')
        resMsg = self.file_data.get('resMsg')
        savePermit = self.file_data.get('savePermit')
        serialNumber = self.file_data.get('serialNumber')
        timeLimit = self.file_data.get('timeLimit')
        updateDate = data.updateTime
        userName = self.file_data.get('userName2')
        whiteList = self.file_data.get('whiteList')
        workTime = self.file_data.get('workTime')
        ret = UserRequest.ent_attr_update(amountLimit,
                                          amountQuery,
                                          bindNumber,
                                          bindPermit,
                                          createDate,
                                          createUser,
                                          creditUser,
                                          downloadPermit,
                                          ext1,
                                          ext2,
                                          ext3,
                                          ext4,
                                          ext5,
                                          ext6,
                                          id,
                                          interfaceCreditUser,
                                          lockStat,
                                          printAmount,
                                          printPermit,
                                          resCode,
                                          resMsg,
                                          savePermit,
                                          serialNumber,
                                          timeLimit,
                                          updateDate,
                                          userName,
                                          whiteList,
                                          workTime, self.cookie)
        Log.info(ret)
        self.assertEqual('00000000', ret.code)
        self.assertIn('操作成功', ret.msg)

    #第三个用户
    def get_page_three(self):
        '''检索第一个用户'''
        curPage = self.file_data.get('curPage')
        maxSize = self.file_data.get('maxSize')
        search_LIKE_userName = self.file_data.get('userName3')
        search_LIKE_nickName = self.file_data.get('nickName3')
        search_IN_orgId = self.file_data.get('orgId')
        search_IN_userType = self.file_data.get('userType')
        search_EQ_stopFlag = self.file_data.get('stopFlag')
        search_EQ_lockFlag = self.file_data.get('lockFlag')
        ret = UserRequest.get_page(curPage,
                                   maxSize,
                                   search_LIKE_userName,
                                   search_LIKE_nickName,
                                   search_IN_orgId,
                                   search_IN_userType,
                                   search_EQ_stopFlag,
                                   search_EQ_lockFlag, self.cookie)
        Log.info(ret)
        self.assertIsNotNone(ret.list)
        return ret.list[0]

    def test_g_update_user(self):
        '''角色和用户解绑'''
        data = self.get_page_three()
        address = data.address
        createNickname = data.createNickname
        createTime = data.createTime
        createUsername = data.createUsername
        deptId = data.deptId
        deptName = data.deptName
        desc1 = data.desc1
        desc2 = data.desc2
        desc3 = data.desc3
        desc4 = data.desc4
        desc5 = data.desc5
        desc6 = data.desc6
        ext1 = data.ext1
        ext10 = data.ext10
        ext11 = data.ext11
        ext12 = data.ext12
        ext13 = data.ext13
        ext14 = data.ext14
        ext15 = data.ext15
        ext16 = data.ext16
        ext17 = data.ext17
        ext18 = data.ext18
        ext19 = data.ext19
        ext2 = data.ext2
        ext20 = data.ext20
        ext21 = data.ext21
        ext22 = data.ext22
        ext23 = data.ext23
        ext24 = data.ext24
        ext25 = data.ext25
        ext26 = data.ext26
        ext27 = data.ext27
        ext28 = data.ext28
        ext29 = data.ext29
        ext3 = data.ext3
        ext30 = data.ext30
        ext4 = data.ext4
        ext5 = data.ext5
        ext6 = data.ext6
        ext7 = data.ext7
        ext8 = data.ext8
        ext9 = data.ext9
        id = data.id
        idCard = data.idCard
        ipbindflag = data.ipbindflag
        ipbindnum = data.ipbindnum
        lockFlag = data.lockFlag
        macbindflag = data.macbindflag
        macbindnum = data.macbindnum
        mark = data.mark
        mobile = data.mobile
        nickName = data.nickName
        orgId = data.orgId
        orgPhone = data.orgPhone
        password = data.password
        plainPassword = data.plainPassword
        postCode = data.postCode
        pwdUpdateTime = data.pwdUpdateTime
        resetFlag = data.resetFlag
        roleName = data.roleName
        salt = data.salt
        shortcutFlag = data.shortcutFlag
        stopFlag = data.stopFlag
        stopReason = data.stopReason
        stopTime = data.stopTime
        telephone = data.telephone
        updateNickname = data.updateNickname
        updateTime = data.updateTime
        updateUsername = data.updateUsername
        userEmail = data.userEmail
        userName = self.file_data.get('userName3')
        userType = data.userType
        weiChat = data.weiChat
        orgTree = self.file_data.get('orgTree')
        roleIds = ''
        assignRoleIds = ''
        ret = UserRequest.user_update(assignRoleIds, address,
                                      createNickname,
                                      createTime,
                                      createUsername,
                                      deptId,
                                      deptName,
                                      desc1,
                                      desc2,
                                      desc3,
                                      desc4,
                                      desc5,
                                      desc6,
                                      ext1,
                                      ext10,
                                      ext11,
                                      ext12,
                                      ext13,
                                      ext14,
                                      ext15,
                                      ext16,
                                      ext17,
                                      ext18,
                                      ext19,
                                      ext2,
                                      ext20,
                                      ext21,
                                      ext22,
                                      ext23,
                                      ext24,
                                      ext25,
                                      ext26,
                                      ext27,
                                      ext28,
                                      ext29,
                                      ext3,
                                      ext30,
                                      ext4,
                                      ext5,
                                      ext6,
                                      ext7,
                                      ext8,
                                      ext9,
                                      id,
                                      idCard,
                                      ipbindflag,
                                      ipbindnum,
                                      lockFlag,
                                      macbindflag,
                                      macbindnum,
                                      mark,
                                      mobile,
                                      nickName,
                                      orgId,
                                      orgPhone,
                                      password,
                                      plainPassword,
                                      postCode,
                                      pwdUpdateTime,
                                      resetFlag,
                                      roleName,
                                      salt,
                                      shortcutFlag,
                                      stopFlag,
                                      stopReason,
                                      stopTime,
                                      telephone,
                                      updateNickname,
                                      updateTime,
                                      updateUsername,
                                      userEmail,
                                      userName,
                                      userType,
                                      weiChat,
                                      orgTree,
                                      roleIds, self.cookie)
        Log.info(ret)
        self.assertEqual('00000000', ret.code)
        self.assertEqual('操作成功', ret.msg)

    def test_h_perattr_update(self):
        '''用户解绑个人征信用户'''
        data = self.get_page_three()
        createDate = data.createTime
        createUser = data.createUsername
        creditUser = ''
        ext1 = data.ext1
        ext2 = data.ext2
        ext3 = data.ext3
        ext4 = data.ext4
        ext5 = data.ext5
        ext6 = data.ext6
        id = data.id
        interfaceCreditUser = ''
        lockStat = self.file_data.get('lockStat')
        printAmount = self.file_data.get('printAmount')
        printPermit = self.file_data.get('printPermit')
        resCode = self.file_data.get('resCode')
        resMsg = self.file_data.get('resMsg')
        savePermit = self.file_data.get('savePermit')
        serialNumber = self.file_data.get('serialNumber')
        updateDate = data.updateTime
        userName = self.file_data.get('userName3')
        whiteList = self.file_data.get('whiteList')
        ret = UserRequest.per_attr_update(createDate,
                                          createUser,
                                          creditUser,
                                          ext1,
                                          ext2,
                                          ext3,
                                          ext4,
                                          ext5,
                                          ext6,
                                          id,
                                          interfaceCreditUser,
                                          lockStat,
                                          printAmount,
                                          printPermit,
                                          resCode,
                                          resMsg,
                                          savePermit,
                                          serialNumber,
                                          updateDate,
                                          userName,
                                          whiteList, self.cookie)
        Log.info(ret)
        self.assertEqual('00000000', ret.code)
        self.assertIn('操作成功', ret.msg)

    def test_i_entattr_update(self):
        '''用户解绑企业征信用户'''
        data = self.get_page_three()
        amountLimit = self.file_data.get('amountLimit')
        amountQuery = self.file_data.get('amountQuery')
        bindNumber = self.file_data.get('bindNumber')
        bindPermit = self.file_data.get('bindPermit')
        createDate = data.createTime
        createUser = data.createUsername
        creditUser = ''
        downloadPermit = self.file_data.get('downloadPermit')
        ext1 = data.ext1
        ext2 = data.ext2
        ext3 = data.ext3
        ext4 = data.ext4
        ext5 = data.ext5
        ext6 = data.ext6
        id = data.id
        interfaceCreditUser = ''
        lockStat = self.file_data.get('lockStat')
        printAmount = self.file_data.get('printAmount')
        printPermit = self.file_data.get('printPermit')
        resCode = self.file_data.get('resCode')
        resMsg = self.file_data.get('resMsg')
        savePermit = self.file_data.get('savePermit')
        serialNumber = self.file_data.get('serialNumber')
        timeLimit = self.file_data.get('timeLimit')
        updateDate = data.updateTime
        userName = self.file_data.get('userName3')
        whiteList = self.file_data.get('whiteList')
        workTime = self.file_data.get('workTime')
        ret = UserRequest.ent_attr_update(amountLimit,
                                          amountQuery,
                                          bindNumber,
                                          bindPermit,
                                          createDate,
                                          createUser,
                                          creditUser,
                                          downloadPermit,
                                          ext1,
                                          ext2,
                                          ext3,
                                          ext4,
                                          ext5,
                                          ext6,
                                          id,
                                          interfaceCreditUser,
                                          lockStat,
                                          printAmount,
                                          printPermit,
                                          resCode,
                                          resMsg,
                                          savePermit,
                                          serialNumber,
                                          timeLimit,
                                          updateDate,
                                          userName,
                                          whiteList,
                                          workTime, self.cookie)
        Log.info(ret)
        self.assertEqual('00000000', ret.code)
        self.assertIn('操作成功', ret.msg)

    def user_get_page_one(self):
        '''检索1'''
        curPage = self.file_data.get('curPage')
        maxSize = self.file_data.get('maxSize')
        search_LIKE_userName = self.file_data.get('userName1')
        search_LIKE_nickName = self.file_data.get('nickName1')
        search_IN_orgId = self.file_data.get('orgId')
        search_IN_userType = self.file_data.get('userType')
        search_EQ_stopFlag = self.file_data.get('stopFlag')
        search_EQ_lockFlag = self.file_data.get('lockFlag')
        ret = UserRequest.get_page(curPage,
                                    maxSize,
                                    search_LIKE_userName,
                                    search_LIKE_nickName,
                                    search_IN_orgId,
                                    search_IN_userType,
                                    search_EQ_stopFlag,
                                    search_EQ_lockFlag,self.cookie)
        Log.info(ret)
        self.assertIsNotNone(ret.list)
        return ret.list[0].id

    def user_get_page_two(self):
        '''检索2'''
        curPage = self.file_data.get('curPage')
        maxSize = self.file_data.get('maxSize')
        search_LIKE_userName = self.file_data.get('userName2')
        search_LIKE_nickName = self.file_data.get('nickName2')
        search_IN_orgId = self.file_data.get('orgId')
        search_IN_userType = self.file_data.get('userType')
        search_EQ_stopFlag = self.file_data.get('stopFlag')
        search_EQ_lockFlag = self.file_data.get('lockFlag')
        ret = UserRequest.get_page(curPage,
                                    maxSize,
                                    search_LIKE_userName,
                                    search_LIKE_nickName,
                                    search_IN_orgId,
                                    search_IN_userType,
                                    search_EQ_stopFlag,
                                    search_EQ_lockFlag,self.cookie)
        Log.info(ret)
        self.assertIsNotNone(ret.list)
        return ret.list[0].id

    def user_get_page_three(self):
        '''检索3'''
        curPage = self.file_data.get('curPage')
        maxSize = self.file_data.get('maxSize')
        search_LIKE_userName = self.file_data.get('userName3')
        search_LIKE_nickName = self.file_data.get('nickName3')
        search_IN_orgId = self.file_data.get('orgId')
        search_IN_userType = self.file_data.get('userType')
        search_EQ_stopFlag = self.file_data.get('stopFlag')
        search_EQ_lockFlag = self.file_data.get('lockFlag')
        ret = UserRequest.get_page(curPage,
                                    maxSize,
                                    search_LIKE_userName,
                                    search_LIKE_nickName,
                                    search_IN_orgId,
                                    search_IN_userType,
                                    search_EQ_stopFlag,
                                    search_EQ_lockFlag,self.cookie)
        Log.info(ret)
        self.assertIsNotNone(ret.list)
        return ret.list[0].id


    def test_j_del_user(self):
        '''删除3个初始用户'''
        sql = 'delete from SYS_USER_LOGIN_LOG'
        self.db.execute(sql)
        Log.info('登录信息表已清空')
        id1 = self.user_get_page_one()
        id2 = self.user_get_page_two()
        id3 = self.user_get_page_three()
        ids = '%s,%s,%s'%(id1,id2,id3)
        ret = UserRequest.del_user(ids,self.cookie)
        Log.info(ret)
        self.assertEqual('00000000',ret.code)
        self.assertEqual('操作成功',ret.msg)

        # 删除页面和接口征信用户

    def credit_user_getpage_api(self):
        '''检索接口用户'''
        curPage = self.file_data.get('curPage')
        maxSize = self.file_data.get('maxSize')
        search_LIKE_creditName = self.file_data.get('creditName_api')
        search_LIKE_creditUser = self.file_data.get('creditUser_api')
        search_LIKE_creditOrgCode = self.file_data.get('creditOrgCode')
        search_EQ_userClass = self.file_data.get('userClass')
        search_IN_deptCode = self.file_data.get('deptCode')
        search_EQ_userStatus = self.file_data.get('search_EQ_userStatus')
        ret = PerCreditUserRequest.per_getpage(curPage, maxSize, search_LIKE_creditName, search_LIKE_creditUser,
                                               search_LIKE_creditOrgCode, search_EQ_userClass, search_IN_deptCode,
                                               search_EQ_userStatus, self.cookie)
        Log.info(ret)
        return ret.list[0].id

    def credit_user_getpage_web(self):
        '''检索页面用户'''
        curPage = self.file_data.get('curPage')
        maxSize = self.file_data.get('maxSize')
        search_LIKE_creditName = self.file_data.get('creditName_web')
        search_LIKE_creditUser = self.file_data.get('creditUser_web')
        search_LIKE_creditOrgCode = self.file_data.get('creditOrgCode')
        search_EQ_userClass = self.file_data.get('userClass')
        search_IN_deptCode = self.file_data.get('deptCode')
        search_EQ_userStatus = self.file_data.get('search_EQ_userStatus')
        ret = PerCreditUserRequest.per_getpage(curPage, maxSize, search_LIKE_creditName, search_LIKE_creditUser,
                                               search_LIKE_creditOrgCode, search_EQ_userClass, search_IN_deptCode,
                                               search_EQ_userStatus, self.cookie)
        Log.info(ret)
        return ret.list[0].id

    def test_k_credit_user_del(self):
        '''征信用户删除'''
        sql1 = 'delete from CPQ_RESULTINFO'
        self.db.execute(sql1)
        sql2 = 'delete from CEQ_RESULTINFO'
        self.db.execute(sql2)
        Log.info('登录信息表已清空')
        id1 = self.credit_user_getpage_api()
        id2 = self.credit_user_getpage_web()
        ids = '%s,%s' % (id1, id2)
        ret = PerCreditUserRequest.per_del(ids, self.cookie)
        Log.info(ret)
        self.assertEqual('00000000', ret.code, '接口调用失败')





if __name__ == "__main__":
    pass